



/**
 * Is used to generate string with the given char
 * @param len		int,	length
 * @param char		char,	character to be repeated
 * @returns			string,	Result
 */
function makeStr(len, ch) {
    return Array.prototype.join.call({length: (len || -1) + 1}, ch || 'x');
}

/**
 * Generates current datatime string
 * 
 * @returns		string, datatime in string format
 */
function genDateStr()
{
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();
	var hh = currentTime.getHours();
	var mm = currentTime.getMinutes();
	var ss = currentTime.getSeconds();
	var ms = currentTime.getMilliseconds();
	
	var returnDate = ms+""+ss+""+mm+""+hh+""+day;
	
	return returnDate;
}

function getRandomNumber(pMin, pMax) {
	return Math.floor((Math.random() * pMax) + pMin);
}

function getKey() {
	var rn = getRandomNumber(10000, 99999);
	var dateStr = genDateStr();
	
	return rn+''+dateStr;
}



////////////////////////////////////////////////////////////////////////////////////////////
module.exports = {
		'genDateStr'					:	genDateStr,
		'makeStr'						:	makeStr,
		'getRandomNumber'				:	getRandomNumber,
		'getKey'						:	getKey,
		
	};